<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
<caption>用户列表</caption>
    <tr>
        <th>id</th><th>用户名</th>
        <th>密码</th><th>昵称</th><th>年龄</th>
    </tr>
    <tr v-for="user in arr">
        <td>{{user.id}}</td><td>{{user.username}}</td>
        <td>{{user.password}}</td><td>{{user.nick}}</td>
        <td>{{user.age}}</td>
    </tr>
</table>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<!--引入axios-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script>
    let vm=new Vue({
        el:"table",
        data:{
            arr:[]
        },
        created:function () {//此方法vue对象创建完之后调用,页面加载完需要做的事写在这里
            axios.get("/select").then(function (response) {
                vm.arr=response.data;

            })

        }
    })
</script>
</body>
</html>